package templatePattern;

/**
 * @author LIBOFEI
 * @ClassName Programmer
 * @description 程序员父类
 * @date 2020/7/14 23:12
 * @Version 1.0
 **/
public abstract class Programmer {

    //程序员一天流程
    public final void today(){
        call();
        breakFast();
        working();

        //如果需要加班，才加班
        if(isNeedWorkOverTime()){
            workOvertime();
        }

        workCommit();
        workAfter();
    }

    public void call(){
        System.out.println("打卡");
    }

    public void breakFast(){
        System.out.println("吃早餐");
    }

    public abstract void working();


    public void workCommit(){
        System.out.println("提交代码");
    }

    public void workAfter(){
        System.out.println("下班");
    }

    /** *
     * 加班
     * @author LIBOFEI
     * @date 23:31 2020/7/14
     * @return void
     * @Version  1.0
     **/
    public void workOvertime(){
        System.out.println("效率太低，苦逼的加班了.....");
    }

    /** *
     * 由具体的子类决定要不要加班，默认不需要加班
     * @author LIBOFEI
     * @date 23:32 2020/7/14
     * @return boolean
     * @Version  1.0
    **/
    public boolean isNeedWorkOverTime(){
        return false;
    }

}
